package xj.toolkit.bean.bytebean.core;

public class ByteBeanUtil {
    public static int type2DefaultByteSize(Class<?> type) {

    	if (type.equals(byte.class)
                || type.equals(Byte.class)) {
            return 1;
        }
       
    	if (type.equals(short.class)
                || type.equals(Short.class)) {
            return 2;
        }
        
    	if (type.equals(int.class)
                || type.equals(Integer.class)) {
            return 4;
        }
        
    	if (type.equals(long.class)
                || type.equals(Long.class)) {
            return 8;
        }
    	
    	if (type.equals(float.class)
                || type.equals(Float.class)) {
            return 4;
        }
    	
    	if (type.equals(double.class)
                || type.equals(Double.class)) {
            return 8;
        }
    	
        return -1;
    }
}
